package com.example.musicrunner;


import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.TextView;

public class MainActivity extends Activity {

private Spinner modeSpinner;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
		this.modeSpinner= (Spinner) this.findViewById(R.id.mode);
		TextView txtView = (TextView) modeSpinner.getSelectedView();
		//txtView.animate();
		setupOpenButton();
		setupMapButton();
	}
	private void setupOpenButton() {
		Button button = (Button) findViewById(R.id.btnOpen);
		button.setOnClickListener(new OnClickListener() {
		   @Override
		   public void onClick(View v) {
			   
			   startActivity(new Intent(MainActivity.this, SetupActivity.class));	   
		 }
		});
	   }
	
	private void setupMapButton() {
		Button button = (Button) findViewById(R.id.btnSpeed);
		button.setOnClickListener(new OnClickListener() {
		   @Override
		   public void onClick(View v) {
			   
			   startActivity(new Intent(MainActivity.this, GpsSpeedActivity.class));	   
		 }
		});
	   }
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}

}
